package com.dms.modules.user.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Data
@ApiModel(value = "UserAddressDTO对象", description = "用户收货地址数据传输对象")
public class UserAddressDTO {

    @ApiModelProperty("地址ID")
    private Long id;

    @ApiModelProperty("用户ID")
    @NotNull(message = "用户ID不能为空")
    private Long userId;

    @ApiModelProperty("收货人姓名")
    @NotBlank(message = "收货人姓名不能为空")
    private String receiverName;

    @ApiModelProperty("收货人电话")
    @NotBlank(message = "收货人电话不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String receiverPhone;

    @ApiModelProperty("省份")
    @NotBlank(message = "省份不能为空")
    private String province;

    @ApiModelProperty("城市")
    @NotBlank(message = "城市不能为空")
    private String city;

    @ApiModelProperty("区县")
    @NotBlank(message = "区县不能为空")
    private String district;

    @ApiModelProperty("详细地址")
    @NotBlank(message = "详细地址不能为空")
    private String detailAddress;

    @ApiModelProperty("是否默认地址（0-否，1-是）")
    private Integer isDefault;
} 